package com.example.thymeleaf_vue_component.config;

import org.springframework.boot.web.server.ConfigurableWebServerFactory;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;

@Configuration
public class ErrorPageConfig {
    @Bean
    public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer() {
        return (factory -> {
            ErrorPage errorPage404 = new ErrorPage(HttpStatus.NOT_FOUND, "/");
            factory.addErrorPages(errorPage404);
        });
    }

    public static void main(String[] args) {
        String NAME = "abc";
        String s2 = NAME.substring(0,1).toUpperCase()+NAME.substring(1);
        System.out.println(s2);
    }
}
